package org.yourscrum.web.story;

import org.springframework.validation.Validator;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;

/**
 * @author Jettro Coenradie
 */
public class TaskValidator implements Validator {
    public boolean supports(Class<?> aClass) {
        return TaskVO.class.isAssignableFrom(aClass);
    }

    public void validate(Object o, Errors errors) {
        ValidationUtils.rejectIfEmptyOrWhitespace(errors,"description", "field.required");
    }
}
